#include "FIFO_Queue.h"
#include "PriorityQueue.h"
#include "assert.h"

void test_1() {
	my::queue<int> s1;
	my::queue<int> s2(10);

	std::cout << s1.empty() << ' ' << s2.empty() << '\n';

	for (int i = 1; i <= 10; ++i) {
		s1.push(i);
	}
	std::cout << s1.size() << '\n';

	while (!s1.empty()) {
		std::cout << s1.front() << ' ';
		s1.pop();
	}

	std::cout << '\n';

	s1.swap(s2);
	std::cout << s1.empty() << ' ' << s2.empty() << '\n';
	std::cout << s1.back() << std::endl;
}

void test_2() {
	std::vector<int> v1{ 9,8,7,6,5,4,3,2,1,0 };
	my::priority_queue<int> pq1;
	my::priority_queue<int> pq2(v1);
	my::priority_queue<int> pq3(v1.begin(), v1.end());
	assert(pq1.empty() == true && pq2.empty() == false && pq3.empty() == false);
	assert(pq1.size() == 0 && pq2.size() == 10 && pq3.size() == 10);
	assert(pq2.top() == 0 && pq3.top() == 0);
	

	for (int i = 10; i > 0; --i) {
		pq1.push(i);
		assert(pq1.top() == i);
	}
	
	for (int i = 2; i <= 10; ++i) {
		pq1.pop();
		assert(pq1.top() == i);
	}
}

int main() {
	test_1();
	test_2();
	return 0;
}